package day04;

import sun.text.normalizer.UBiDiProps;

import java.util.Scanner;

public class Guessing {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int a=(int)(Math.random()*1000)+1;
        System.out.println(a);
        System.out.println("猜数字");
        int se;
        do{
            System.out.println("猜吧!");
             se=scan.nextInt();
             if (se>a) {
                 System.out.println("猜大了");
             }else if (se<a) {
                 System.out.println("猜小了");
             }else {
                 System.out.println("恭喜你猜对了");
             }
        }while(se!=a);
        int command = scan.nextInt();
        switch (command){
            case 1:
                System.out.println("取款");
                break;
            case 2:
                System.out.println("存款");
                break;
            case 3:
                System.out.println("查询");
                break;
            case 0:
                System.out.println("退出");
                break;
            default:
                System.out.println("输入错误");

        }
        int b=(int) (Math.random()*1000+1);
        System.out.println(b);
        int c=scan.nextInt();
        System.out.println("猜吧！");
        while (c!=b){
            if (c>b){
                System.out.println("猜大了");
            }else if (c<b){
                System.out.println("猜小了");
            }
            System.out.println("猜吧！");
            c=scan.nextInt();
        }
        System.out.println("恭喜你猜对了");

        do {
            System.out.println("猜吧!");
            c=scan.nextInt();
            if (c>b){
                System.out.println("猜大了");
            }else if (c<b){
                System.out.println("猜小了");
            }else{
                System.out.println("恭喜你猜对了");
            }
        }while (c!=b);

        for (int j=0;j<5;j++){
            System.out.println("行动是成功的阶梯");
        }
        System.out.println("继续执行");
        for (int k=1;k<=9;k++){
            System.out.println(k+"*9="+k*9);
        }
        for (int l=1;l<=9;l+=2){
            System.out.println(l+"*9="+l*9);
        }
        for (int n=9;n>0;n--){
            System.out.println(n+"*9="+n*9);
        }




















        /*
        int se=scan.nextInt();
        while (se!=a){
            if (se>a){
                System.out.println("猜大了");
            }else {
                System.out.println("猜小了");
            }
            System.out.println("猜吧！");
            se=scan.nextInt();
        }
        System.out.println("恭喜你才对了");
        */

    }

}
